<html>
<head><meta charset="utf-8"><title>build-std, sysroots, and backtrace · general · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/index.html">general</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/build-std.2C.20sysroots.2C.20and.20backtrace.html">build-std, sysroots, and backtrace</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="229122096"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/build-std%2C%20sysroots%2C%20and%20backtrace/near/229122096" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/build-std.2C.20sysroots.2C.20and.20backtrace.html#229122096">(Mar 06 2021 at 19:23)</a>:</h4>
<p>cc <span class="user-mention" data-user-id="220273">@Jane Lusby</span></p>



<a name="229122282"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/build-std%2C%20sysroots%2C%20and%20backtrace/near/229122282" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/build-std.2C.20sysroots.2C.20and.20backtrace.html#229122282">(Mar 06 2021 at 19:26)</a>:</h4>
<p>So, the background as I understand it:<br>
sysroots predate Rust, and come from the C world originally. They're the mechanism compilers use to supply libraries and matching headers. They're particularly common when cross-compiling, so that you can point to a set of headers and libraries that aren't your system headers and libraries. (For instance, "here's the C library for arm64, and here are the matching glibc headers for arm64, which don't match my system's x86-64 library and headers".)</p>



<a name="229122298"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/build-std%2C%20sysroots%2C%20and%20backtrace/near/229122298" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/build-std.2C.20sysroots.2C.20and.20backtrace.html#229122298">(Mar 06 2021 at 19:26)</a>:</h4>
<p>In the Rust context, the sysroot contains the crates that ship with the compiler and aren't ever fetched from <a href="http://crates.io">crates.io</a>.</p>



<a name="229122346"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/build-std%2C%20sysroots%2C%20and%20backtrace/near/229122346" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/build-std.2C.20sysroots.2C.20and.20backtrace.html#229122346">(Mar 06 2021 at 19:27)</a>:</h4>
<p>That includes <code>proc_macro</code>, <code>std</code>, <code>core</code>, <code>alloc</code>, and a handful of others.</p>



<a name="229122536"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/build-std%2C%20sysroots%2C%20and%20backtrace/near/229122536" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/build-std.2C.20sysroots.2C.20and.20backtrace.html#229122536">(Mar 06 2021 at 19:30)</a>:</h4>
<p>A rustc installation "knows" where to find its sysroot for a given target, though you can override it.</p>



<a name="229122607"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/build-std%2C%20sysroots%2C%20and%20backtrace/near/229122607" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/build-std.2C.20sysroots.2C.20and.20backtrace.html#229122607">(Mar 06 2021 at 19:32)</a>:</h4>
<p>The goal here would be to use the same mechanism or a similar mechanism to reference a packaged copy of the source of std/alloc/core/etc that came from the same Rust distribution as the compiler. rustup could distribute that. (We already provide a <code>rust-src</code> component, and in theory we could just use that; it's just larger than it would need to be, so by the time this becomes stable we may want to have a pared-down component that just has the bits needed for build-std.)</p>



<a name="229122649"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/build-std%2C%20sysroots%2C%20and%20backtrace/near/229122649" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/build-std.2C.20sysroots.2C.20and.20backtrace.html#229122649">(Mar 06 2021 at 19:32)</a>:</h4>
<p>Either that component would form part of the default Rust install, or you'd have to install that component to use build-std.</p>



<a name="229122690"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/build-std%2C%20sysroots%2C%20and%20backtrace/near/229122690" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/build-std.2C.20sysroots.2C.20and.20backtrace.html#229122690">(Mar 06 2021 at 19:33)</a>:</h4>
<p>Solving that is partly a logistical issue (coordinate with rustup), and partly a technical one ("which bits do we need to have to successfully build-std").</p>



<a name="229122825"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/build-std%2C%20sysroots%2C%20and%20backtrace/near/229122825" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/build-std.2C.20sysroots.2C.20and.20backtrace.html#229122825">(Mar 06 2021 at 19:34)</a>:</h4>
<p>That's one hurdle. Another would be to then make sure that build-std works as expected and passes tests. And once those work reliably, we'd need to finish the cargo integration.</p>



<a name="229122844"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/build-std%2C%20sysroots%2C%20and%20backtrace/near/229122844" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/build-std.2C.20sysroots.2C.20and.20backtrace.html#229122844">(Mar 06 2021 at 19:35)</a>:</h4>
<p>There's a group working on this, that's tracking the issues involved: <a href="https://github.com/rust-lang/wg-cargo-std-aware">https://github.com/rust-lang/wg-cargo-std-aware</a></p>



<a name="229123041"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/build-std%2C%20sysroots%2C%20and%20backtrace/near/229123041" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/build-std.2C.20sysroots.2C.20and.20backtrace.html#229123041">(Mar 06 2021 at 19:38)</a>:</h4>
<p>Does that help?</p>



<a name="229123139"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/build-std%2C%20sysroots%2C%20and%20backtrace/near/229123139" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jane Lusby <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/build-std.2C.20sysroots.2C.20and.20backtrace.html#229123139">(Mar 06 2021 at 19:39)</a>:</h4>
<p>Yes</p>



<a name="229123145"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/build-std%2C%20sysroots%2C%20and%20backtrace/near/229123145" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jane Lusby <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/build-std.2C.20sysroots.2C.20and.20backtrace.html#229123145">(Mar 06 2021 at 19:39)</a>:</h4>
<p>Tyty</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>